<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
    <div></div>
    <div></div>
    <script>
        //1.数组的合并
        const shuiguo1 = ['苹果', '香蕉'];
        const shuiguo2 = ['椰子', '香梨'];
        //ES5写法 
        const result = shuiguo1.concat(shuiguo2);
        console.log(result);

        //Es6扩展运算符写法
        const mingxing1 = ['刘德华', '张学友'];
        const mingxing2 = ['黄渤', '艾伦'];
        const result1 = [...mingxing1, ...mingxing2]
        console.log(result1);

        //2.数组的克隆
        const sanzhihua = ['A', 'G', 'M'];
        const sanyecao = [...sanzhihua];
        console.log("2.数组的克隆:", sanyecao); //浅拷贝

        //3.将伪数组转成真正的数组
        let divs = document.querySelectorAll('div');
        let divArr = [...divs];
        console.log(divArr);
    </script>
</body>
</html>